local targetKills = 250

ACHIEVEMENT.Name			= "Terrorists Win"
ACHIEVEMENT.Description		= "Kill "..targetKills.." enemies using the AK47."
ACHIEVEMENT.Icon			= nil --define if needed

function ACHIEVEMENT:OnNPCKilled (npc, atk, wpn) --this would be called as if it were a hook to the function it is named after.
	if (!IsValid(atk) or !atk:IsPlayer()) then return end
	
	local weap = atk:GetActiveWeapon()
	if ( !IsValid( weap ) ) then return end
	
	if not (weap:GetClass() == "weapon_ic_ak47") then return end
	
	printd ("Terrorist pass.")
	
	local kills = self:GetValue( atk, "kills", 0 )
	self:SetValue( atk, "kills", kills + 1 )
end

function ACHIEVEMENT:CompletionConditions (ply) --if this returns true, they earn the achievement
	return self:GetValue( ply, "kills", 0 ) > targetKills
end

function ACHIEVEMENT:FractionComplete (ply)
	return self:GetValue( ply, "kills", 0 ) / targetKills --and hopefully YOU can round this down to 1
end

function ACHIEVEMENT:StatusText( ply )
	return math.min( self:GetValue( ply, "kills", 0 ), targetKills ) .. "/" ..targetKills
end
